# ##############################################################################
# drivers/ETH/MAC/Tricore/CMakeLists.txt
#
# Copyright (c) 2025 Li Auto Inc. and its affiliates
# Licensed under the Apache License, Version 2.0(the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#     http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ##############################################################################
set(ETH_STACK_E3XX_GETHMAC_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Path from drivers/Eth_GethMac")

set(ETHGETHMAC_E3XX_INC)
set(ETHGETHMAC_E3XX_SRCS)

if(CONFIG_MAC_E3XX)
    nuttx_add_library(eth_gethmac STATIC)
    list(APPEND ETHGETHMAC_E3XX_INC
        ${ETH_STACK_E3XX_GETHMAC_DIR}/e3650
        ${NUTTX_DIR}/../../components/rt_framework/inc/
    )

    file(GLOB_RECURSE ETHGETHMACSRCS
        ${ETH_STACK_E3XX_GETHMAC_DIR}/e3650/*.c
    )

    list(APPEND ETHGETHMAC_E3XX_SRCS
        ${ETHGETHMACSRCS}
    )

    target_include_directories(eth_gethmac PRIVATE ${ETHGETHMAC_E3XX_INC})
    target_sources(eth_gethmac PRIVATE ${ETHGETHMAC_E3XX_SRCS})

endif()
